package com.goldsprite.gameframeworks.input;

public abstract class InputBinding {
	public final String name;
	protected InputAction action;

	public InputBinding() {
		name = getClass().getSimpleName();
	}

	public InputBinding(String name) {
		this.name = name;
	}

	public InputAction getAction() {
		return action;
	}
	public void setInputAction(InputAction action) {
		this.action = action;
	}

	public boolean matchesKey(int keyboardCode) {
		return false;
	}

	/**
	 * @return 是否变更了值
	 */
	public abstract boolean updateValue();

	/**
	 * @return 是否有任意输入
	 */
	public abstract boolean isHold();

	@Override
	public String toString() {
		return "["+name+"]: "+super.toString();
	}
}
